package com.yongbao.model.util;

import com.yongbao.model.dtomapper.AdminRoleDtoMapper;
import com.yongbao.model.domain.AdminRoleDO;
import com.yongbao.model.vo.AdminRoleVO;
import com.google.common.collect.Lists;
import org.apache.commons.collections4.CollectionUtils;

import java.util.ArrayList;
import java.util.List;

/**
 * @author zhanghong
 */
public class AdminRoleConvert {

    public static List<AdminRoleVO> buildAdminRoleVoList(List<AdminRoleDO> adminRoleDOList) {
        if (CollectionUtils.isEmpty(adminRoleDOList)) {
            return Lists.newArrayList();
        }
        List<AdminRoleVO> adminRoleVOList = new ArrayList<>();
        for (AdminRoleDO adminRoleDO : adminRoleDOList) {
            adminRoleVOList.add(AdminRoleDtoMapper.INSTANCE.do2VO(adminRoleDO));
        }

        return adminRoleVOList;
    }
}
